export const blacklistSchema = {
    type: "page",
    title: "黑名单",
    body: {
        type: "crud",
        api: "/api/volunteer/blacklist",
        primaryField: 'user_id',
        columnsTogglable: false,
        filter: {
            title: "",
            submitText: "",
            panelClassName: 'm-b-none bg-gd no-border',
            bodyClassName: 'wrapper-sm',
            mode: "inline",
            controls: [
                {
                    type: "text",
                    name: "keyword",
                    placeholder: "用户名、联系电话、证件号码",
                    style: {minWidth: 260},
                    addOn: {
                        type: "submit",
                        label: "搜索",
                        primary: true
                    }
                },
            ]
        },
        toolbarInline: true,
        bulkActions: [
            {
                type: "button",
                label: "移出黑名单",
                level: "success",
                size: 'sm',
                actionType: "ajax",
                api: "post:/api/volunteer/unblack/${ids}"
            }
        ],
        columns: [
            {
                name: "id",
                label: "志愿者ID",
                width: 50
            },
            {
                name: "real_name",
                label: "姓名",
            },
            {
                name: "username",
                label: "用户"
            },
            {
                name: "sex",
                label: "性别",
                type: 'map',
                map: {
                    '1': '男',
                    '2': '女'
                }
            },
            {
                label: "年龄",
                name: "age"
            },
            {
                label: "联系电话",
                name: "phone"
            },
            {
                label: "居住区域",
                innerClassName: 'w',
                type: "tpl",
                tpl: "${province_name} ${city_name} ${county_name} ${addr}"
            },

            {
                label: "参与项目数",
                name: 'project_count'
            },
            {
                label: "志愿时长",
                name: 'reward_time'
            },
            {
                label: "积分",
                name: 'score'
            },
            {
                name: "created_at",
                label: "注册日期",
                width: 120,
            },

            {
                name: "blacked_at",
                label: "拉黑日期",
                width: 120,
            },

            {
                label: "备注",
                name: "black_reason",
                width: 120,
            }
        ]
    }
};
